<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <title><?php echo isset($pageTitle) ? $pageTitle : $siteName; ?></title>
    <meta name="name" content="<?php echo htmlentities($siteName); ?>" />
    <meta name="description" content="<?php echo htmlentities($siteDescription); ?>" />

    <?php // Force hiptops to use the handheld stylesheet because they're dumb. ?>
    <?php if (strpos($userAgent, 'Danger hiptop') !== false): ?>
      <link rel="stylesheet" type="text/css" href="<?php echo $themeUrl; ?>/css/wonko-handheld.css" />
    <?php else: ?>
      <link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/2.2.2/build/fonts/fonts-min.css" media="screen,print,projection" />
      <link rel="stylesheet" type="text/css" href="<?php echo $themeUrl; ?>/css/prettify.css" media="screen,print,projection" />
      <link rel="stylesheet" type="text/css" href="<?php echo $themeUrl; ?>/css/wonko.css" media="screen,print,projection" />
      <link rel="stylesheet" type="text/css" href="<?php echo $themeUrl; ?>/css/wonko-handheld.css" media="handheld" />
      <?php
      /*
      <link rel="stylesheet" type="text/css" href="<?php echo $themeRelativeUrl; ?>/css/prettify.css,<?php echo $themeRelativeUrl; ?>/css/wonko.css" media="screen,print,projection" />
      */
      ?>
    <?php endif; ?>

    <?php if ($admin): ?>
      <link rel="stylesheet" type="text/css" href="<?php echo $themeUrl; ?>/css/admin.css" />
    <?php endif; ?>

    <meta name="geo.position" content="37.250691;-121.78952" />
    <meta name="geo.region" content="US-CA" />
    <meta name="geo.placename" content="San Jose, California" />

    <link rel="openid.server" href="http://www.myopenid.com/server" />
    <link rel="openid.delegate" href="http://wonko.myopenid.com/" />
    <meta http-equiv="X-XRDS-Location" content="http://wonko.myopenid.com/xrds" />

    <meta name="y_key" content="7eb18df9df74cc49" />

    <link rel="alternate" type="application/atom+xml" href="http://feeds.feedburner.com/wonko" title="Articles (Atom and RSS)" />

    <?php if (isset($feedAtom)): ?>
      <link rel="alternate" type="application/atom+xml" href="<?php echo $feedAtom; ?>" title="This page (Atom)" />
    <?php endif; ?>

    <?php if (isset($feedRSS)): ?>
      <link rel="alternate" type="application/rss+xml" href="<?php echo $feedRSS; ?>" title="This page (RSS)" />
    <?php endif; ?>

    <link rel="icon" href="<?php echo $themeUrl; ?>/images/favicon.png" />
    <link rel="shortcut icon" href="<?php echo $themeUrl; ?>/images/favicon.png" />

    <style type="text/css" media="screen">
      #randomphoto {
        background: url('<?php echo $themeUrl; ?>/images/header-backgrounds/<?php echo rand(1, 59); ?>.jpg') no-repeat;
      }
    </style>

    <style type="text/css" media="handheld">
      #randomphoto { background: #fff; }
    </style>
  </head>
  
  <body>
    <div id="page">
      <div id="header">
        <div id="randomphoto">
          <div id="logo" onclick="window.location='<?php echo $siteUrl; ?>';">
            <a href="<?php echo $siteUrl; ?>" title="<?php echo htmlentities($siteName); ?>">
              <?php echo htmlentities($siteName); ?>
            </a>
          </div>
        </div>

        <div id="toolbar">
          <div class="subtitle"><?php echo htmlentities($siteDescription); ?></div>
          
          <ul class="robots-nocontent">
            <li><a href="<?php echo $siteUrl; ?>">Home</a></li>
            <li><a href="<?php echo $siteUrl; ?>/page/about">About</a></li>
            <li><a href="<?php echo $siteUrl; ?>/archive">Archive</a></li>
            <li><a id="link-recent-comments" href="<?php echo $siteUrl; ?>/recent-comments">Comments</a></li>
          </ul>
        </div>
        
        <?php Pants::partial('admin/toolbar'); ?>
      </div>

      <div id="content">
